cmake_minimum_required(VERSION 3.10)
project(vnc-record)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)

set(BIN_NAME vnc_record)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)

find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5WebSockets REQUIRED)
find_package(ZLIB REQUIRED)

include_directories( ${ZLIB_INCLUDE_DIRS})
add_executable(${BIN_NAME}
    main.cpp
    zlib/zlib_tool.cpp
    rfb/encoding_tight.cpp
    rfb/rfb_data_process.cpp
    rfb/lock_stream.cpp
    ffmpeg/raw2mp4.cpp)
target_link_libraries(${BIN_NAME}
    Qt5::Core
    Qt5::Gui
    Qt5::Network
    Qt5::WebSockets
    ${ZLIB_LIBRARIES}
    libavutil.so
    libavcodec.so
    libavformat.so
    libswscale.so
    pthread)

